#ifndef	___USART_H___
#define	___USART_H___

#include "stm32f10x.h"
#include "FSM.h"
#include "delay.h"

//使用usart2作为在指令传输的通道
#define USART_CMD_CHANNEL			USART2
//关闭指令通道
#define USART_CloseCmdChannel()		(USART_ITConfig(USART2, USART_IT_RXNE, DISABLE))
//打开指令通道 
#define USART_OpenCmdChannel()		(USART_ITConfig(USART2, USART_IT_RXNE, ENABLE))

#define	USART2_GPIO	                GPIOA
#define USART2_TX_PIN	            GPIO_Pin_2
#define	USART2_RX_PIN	            GPIO_Pin_3
#define RCC_APB2Periph_GPIOx        RCC_APB2Periph_GPIOA

#define USART2_BaudRate             115200



extern void USART2_Configuration(void);

extern void UARTSendChar(USART_TypeDef* USARTx,uint8_t c);

//extern void UART1SendString(uint8_t *s,int len);
extern void UART2SendString(uint8_t *s,int len);
//extern void UART3SendString(uint8_t *s,int len);

#endif
